/**
 *ZHU framework. Copyright 2007-, all rights reserved.
 *
 * $Id$
 * $Revision$
 * $Date$
 * $Author$
 */
package daily.entity;

import javax.persistence.*;
import javax.persistence.Entity;

import zhu.framework.entity.*;

/**
 * @author xiaopengzhu
 * 
 */
@Entity
@Table
public class Files extends AbstractEntityWithLongId {

	/**
	 * @return the filename
	 */
	public String getFilename() {
		return filename;
	}

	/**
	 * @param filename
	 *            the filename to set
	 */
	public void setFilename(final String filename) {
		this.filename = filename;
	}

	/**
	 * @return the byteFile
	 */
	public byte[] getByteFile() {
		return byteFile;
	}

	/**
	 * @param byteFile
	 *            the byteFile to set
	 */
	public void setByteFile(final byte[] byteFile) {
		this.byteFile = byteFile;
	}

	/**
	 * @return the contentTyp
	 */
	public String getContentTyp() {
		return contentTyp;
	}

	/**
	 * @param contentTyp
	 *            the contentTyp to set
	 */
	public void setContentTyp(final String contentTyp) {
		this.contentTyp = contentTyp;
	}

	/**
	 * @return the uploadStaff
	 */
	public Staff getUploadStaff() {
		return uploadStaff;
	}

	/**
	 * @param uploadStaff
	 *            the uploadStaff to set
	 */
	public void setUploadStaff(final Staff uploadStaff) {
		this.uploadStaff = uploadStaff;
	}

	private static final long serialVersionUID = 1L;

	private String filename;

	@Basic(fetch = FetchType.LAZY)
	private byte[] byteFile;

	private String contentTyp;

	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }, optional = false, fetch = FetchType.EAGER)
	@JoinColumn(name = "update_staff_id", nullable = false)
	private Staff uploadStaff;

}
